function Color(r,g,b,a)
{
	this.r=r;
	this.g=g;
	this.b=b;
	this.a=a;
	return this;
}
function adv_RGBZhuanColor(RGB)//rgb(r,g,b) or rgba(r,g,b,a) or #rrggbb
{
	RGB=RGB.replace(/\s+/g,"");
	if(RGB[0]=="#")
	{
		console.log(new Color(parseInt(RGB.substring(1,3),16),parseInt(RGB.substring(3,5),16),parseInt(RGB.substring(5,7),16),parseInt(RGB.substring(7,8),16)))
		return new Color(parseInt(RGB.substring(1,3),16),parseInt(RGB.substring(3,5),16),parseInt(RGB.substring(5,7),16),parseInt(RGB.substring(7,8),16));
	}
	else if(RGB.substring(0,4)=="rgba")
	{
		RGB=RGB.substring(RGB.search('[(]')+1,RGB.search('[)]'));
		arr=RGB.split(",");
		return new Color(parseInt(arr[0]),parseInt(arr[1]),parseInt(arr[2]),parseInt(arr[3]));
	}
	else if(RGB.substring(0,3)=="rgb")
	{
		RGB=RGB.substring(RGB.search('[(]')+1,RGB.search('[)]'));
		arr=RGB.split(",");
		//console.log(arr)
		return new Color(parseInt(arr[0]),parseInt(arr[1]),parseInt(arr[2]));
	}
}
function adv_ColorZhuanRGB(RGB)
{
	
	return (isNaN(RGB.a))?"rgb("+RGB.r.toString(10)+","+RGB.g.toString(10)+","+RGB.b.toString(10)+")":"rgba("+RGB.r.toString(10)+","+RGB.g.toString(10)+","+RGB.b.toString(10)+","+RGB.a.toString(10)+")";
}
function Color(r,g,b,a)
{
	this.r=r;
	this.g=g;
	this.b=b;
	this.a=a;
	return this;
}